<%-- 
    Document   : cartpane
    Created on : Aug 3, 2012, 11:22:51 PM
    Author     : Atienza-Home
--%>
<%@page import="java.util.Iterator"%>
<%@page import="Factory.Tables.Cart"%>
<%@page import="java.util.ArrayList"%>
<%

    ArrayList<Cart> result = (ArrayList<Cart>)session.getAttribute("usercart");
    Iterator<Cart> iter;
    Cart cart;
    
    int i=0;
    
    

%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<font size="5px" color="white">My Cart</font><br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color="white">*Note: The maximum amount of movies you can put in your cart is 30. You can drop some movies to lessen in your cart.</font><br><br><br>
<div id="scrollablecart" style="overflow : auto;background-color: #009999;width:850px;height:450px;margin: auto;">
    
    
    
    
    
    
    
    <table cellspacing="1" class="tablesorter">
    <thead>    
    <tr>
        <th>Price</th>
        
            
            
    </tr>
            
    </thead>        
    <tbody> 
        <tr>
            <td>1</td>
            
        </tr>
        <tr>
            <td>2</td>
            
        </tr>
        <tr>
            <td>3</td>
            
        </tr>
    </tbody>
    </table>
    
    
    
    
    
    
    
    
    
    
    <table cellspacing="1" class="tablesorter">
    <thead>    
    <tr>
        <th>Price</th>
        <th></th>
        <th>Name</th>
        <th>Added</th>
        <th></th>
            
            
    </tr>
            
    </thead>        
    <tbody>        
        
    
    <%
        if(result!=null){
            iter = result.iterator(); 
            while(iter.hasNext() && i<50){
                cart = iter.next();
                
                %>
                <tr style="border: 2px solid #006666">
                    
                    <td style="text-align: center;">
                        <font color="white" size="2px">Price:</font><br>
                        <font color="white" size="4px" style="font-weight:bold;"><%=cart.getMovie().getPrice() %></font>
                        
                        
                    </td>
                                            
                    <td style="text-align: center">
                    <div style="background-color: black;width:174px;height:98px;">
                        <img style="max-width: 174px;max-height:98px;" src="images/movie/<%=cart.getMovie().getMoviePic() %>">
                    </div>
                    </td>
                    
                    
                        
                    <td style="text-align: center;width: 200px;">
                        <font color="white">
                            <%=cart.getMovie().getName()%><br>
                            <span size="2px">Rating: <%=cart.getMovie().getRating()%></span>
                        
                        </font>                     
                        
                        
                    </td>
                    
                    <td style="text-align: center;width: 150px; ">
                        
                        
                       
                        <font color="white">
                            <%=cart.getcartDate()%><br>
                            <%=cart.getcartTime()%>
                        </font>
                        
                        
                    </td>
                    
                    <td >
                        
                        <input type="button" value="Drop">
                        <input type="button" value="Mark">
                        
                        
                        
                    </td>
                    
                    
                </tr>
            <%
            }
        }%>
    </tbody>    
    </table>
    
</div>

